package com.ruoyi.sale.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sale.mapper.SaleStoreoutDetailMapper;
import com.ruoyi.sale.domain.SaleStoreoutDetail;
import com.ruoyi.sale.service.ISaleStoreoutDetailService;

/**
 * 销售出库详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-03
 */
@Service
public class SaleStoreoutDetailServiceImpl implements ISaleStoreoutDetailService 
{
    @Autowired
    private SaleStoreoutDetailMapper saleStoreoutDetailMapper;

    /**
     * 查询销售出库详情
     * 
     * @param id 销售出库详情主键
     * @return 销售出库详情
     */
    @Override
    public SaleStoreoutDetail selectSaleStoreoutDetailById(Long id)
    {
        return saleStoreoutDetailMapper.selectSaleStoreoutDetailById(id);
    }

    /**
     * 查询销售出库详情列表
     * 
     * @param saleStoreoutDetail 销售出库详情
     * @return 销售出库详情
     */
    @Override
    public List<SaleStoreoutDetail> selectSaleStoreoutDetailList(SaleStoreoutDetail saleStoreoutDetail)
    {
        return saleStoreoutDetailMapper.selectSaleStoreoutDetailList(saleStoreoutDetail);
    }

    /**
     * 新增销售出库详情
     * 
     * @param saleStoreoutDetail 销售出库详情
     * @return 结果
     */
    @Override
    public int insertSaleStoreoutDetail(SaleStoreoutDetail saleStoreoutDetail)
    {
        saleStoreoutDetail.setCreateTime(DateUtils.getNowDate());
        return saleStoreoutDetailMapper.insertSaleStoreoutDetail(saleStoreoutDetail);
    }

    /**
     * 修改销售出库详情
     * 
     * @param saleStoreoutDetail 销售出库详情
     * @return 结果
     */
    @Override
    public int updateSaleStoreoutDetail(SaleStoreoutDetail saleStoreoutDetail)
    {
        saleStoreoutDetail.setUpdateTime(DateUtils.getNowDate());
        return saleStoreoutDetailMapper.updateSaleStoreoutDetail(saleStoreoutDetail);
    }

    /**
     * 批量删除销售出库详情
     * 
     * @param ids 需要删除的销售出库详情主键
     * @return 结果
     */
    @Override
    public int deleteSaleStoreoutDetailByIds(Long[] ids)
    {
        return saleStoreoutDetailMapper.deleteSaleStoreoutDetailByIds(ids);
    }

    /**
     * 删除销售出库详情信息
     * 
     * @param id 销售出库详情主键
     * @return 结果
     */
    @Override
    public int deleteSaleStoreoutDetailById(Long id)
    {
        return saleStoreoutDetailMapper.deleteSaleStoreoutDetailById(id);
    }
}
